package com.cyclinggle.cloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cyclinggle.cloud.model.User;
import com.cyclinggle.cloud.service.UserService;

@RestController
@RequestMapping("/users")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@PostMapping("/")
	public String search(@RequestBody User user) {
		return userService.get(user);
	}
	
	@PostMapping("/add")
	public String add(@RequestBody User user) {
		return userService.add(user);
	}	
}
